<?php
// 应用公共文件
/**
 * 通用化API数据格式输出
 * @param $status
 * @param $message
 * @param $data
 * @param $httpStatus
 * @return \think\response\Json
 */
function show($status, $message = 'error', $data = [], $httpStatus = 200){
    $result = [
        'code'=>$status,
        'msg'=>$message,
        'data'=>$data,
    ];
    return json($result,$httpStatus);
}

function showList($status, $message = 'error', $data = [], $total = 0,  $httpStatus = 200){
    $result = [
        'code'=>$status,
        'msg'=>$message,
        'rows'=>$data,
        'total'=>$total,
    ];
    return json($result,$httpStatus);
}
